home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 14U9JCU (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.7 KB  |  67 lines

  1. package com.sun.java.swing.text;
  2.  
  3. import com.sun.java.swing.undo.AbstractUndoableEdit;
  4. import com.sun.java.swing.undo.CannotRedoException;
  5. import com.sun.java.swing.undo.CannotUndoException;
  6. import java.util.Vector;
  7.  
  8. class StringContent$InsertUndo extends AbstractUndoableEdit {
  9.    // $FF: synthetic field
  10.    StringContent this$0;
  11.    protected int offset;
  12.    protected int length;
  13.    protected String string;
  14.    protected Vector posRefs;
  15.  
  16.    // $FF: synthetic method
  17.    protected StringContent$InsertUndo(StringContent this$0, int offset, int length) {
  18.       this.this$0 = this$0;
  19.       this.offset = offset;
  20.       this.length = length;
  21.    }
  22.  
  23.    public void undo() throws CannotUndoException {
  24.       super.undo();
  25.  
  26.       try {
  27.          synchronized(this.this$0){}
  28.  
  29.          try {
  30.             if (this.this$0.marks != null) {
  31.                this.posRefs = this.this$0.getPositionsInRange((Vector)null, this.offset, this.length);
  32.             }
  33.  
  34.             this.string = this.this$0.getString(this.offset, this.length);
  35.             this.this$0.remove(this.offset, this.length);
  36.          } catch (Throwable var4) {
  37.             throw var4;
  38.          }
  39.  
  40.       } catch (BadLocationException var5) {
  41.          throw new CannotUndoException();
  42.       }
  43.    }
  44.  
  45.    public void redo() throws CannotRedoException {
  46.       super.redo();
  47.  
  48.       try {
  49.          synchronized(this.this$0){}
  50.  
  51.          try {
  52.             this.this$0.insertString(this.offset, this.string);
  53.             this.string = null;
  54.             if (this.posRefs != null) {
  55.                this.this$0.updateUndoPositions(this.posRefs);
  56.                this.posRefs = null;
  57.             }
  58.          } catch (Throwable var4) {
  59.             throw var4;
  60.          }
  61.  
  62.       } catch (BadLocationException var5) {
  63.          throw new CannotRedoException();
  64.       }
  65.    }
  66. }
  67.